package com.qingzhuge.member.enums;

import com.qingzhuge.common.IBaseEnum;

import java.util.HashMap;
import java.util.Map;

/**
 * @author : zero.xiao
 * @description : 第三方登录类型
 * @date : 2018/10/8 0008 下午 19:46
 * @modified :
 * @since :
 */
public enum EnumThirdOauthType implements IBaseEnum<String> {
    /**h5*/
    wap("h5"),
    /**app*/
    app("app"),
    /**微信*/
    weixin("weixin"),
    /**支付宝*/
    alipay("alipay");

    private final String value;
    private final static Map<String, EnumThirdOauthType> VALUE_CACHE = new HashMap<>();

    static {
        for (EnumThirdOauthType c : values()) {
            VALUE_CACHE.put(c.value, c);
        }
    }

    EnumThirdOauthType(String value) {
        this.value = value;
    }

    @Override
    public String value() {
        return this.value;
    }

    public static EnumThirdOauthType fromValue(String value) {
        return VALUE_CACHE.get(value);
    }

    @Override
    public String toString() {
        return this.value;
    }
}
